/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package concreteBuilders;

import builderProduct.AbstractBuilder;
import builderProduct.FileProduct;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.FileHandler;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Rente
 */
public class BinaryFileBuilder extends AbstractBuilder{


    private ObjectOutputStream out;

    @Override
    public void buildCabecalho() {
        System.out.println("Binarie Cabeçalho");
    }

    @Override
    public void buildCorpo() {
        System.out.println("binarie corpo");
    }

    @Override
    public void buildExtensao() {
        fb.setExtensao("rel");
    }

//    @Override
//    public void saveFile() {
//        try {
//            out = new ObjectOutputStream(new FileOutputStream(new File("OP"+ getDateTime()+".rel")));
//            out.writeObject(super.getVal());
//            out.close();
//        } catch (IOException ex) {
//            Logger.getLogger(FileHandler.class.getName()).log(Level.SEVERE, null, ex);
//        }
//    }
//
//    private String getDateTime() {
//        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd#HH_mm");
//        Date date = new Date();
//        return dateFormat.format(date);
//    }

}
